package com.hxexp.weixin.test;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;

import com.hxexp.weixin.common.jaxb.JaxbMarshallerHelper;
import com.qq.weixin.mp.message.hxexp.model.send.TextReplyJaxb;

@RunWith(BlockJUnit4ClassRunner.class)
public class JaxbMarshallerHelperTester {
    @Test
    public void testMarshal() {
        TextReplyJaxb txtmsg = new TextReplyJaxb();
        txtmsg.setToUserName("gh_ac216ed6e766");
        txtmsg.setFromUserName("o5GuMs3VA_8xB6VCNKaTdFQHVQ_U");
        txtmsg.setCreateTime(1428562454L);
        txtmsg.setMsgType("text");
        txtmsg.setContent("测试消息");
//
//        ImageReplyJaxb imageMsg = new ImageReplyJaxb();
//        imageMsg.setToUserName("gh_ac216ed6e766");
//        imageMsg.setFromUserName("o5GuMs3VA_8xB6VCNKaTdFQHVQ_U");
//        imageMsg.setCreateTime(1428562454L);
//        imageMsg.setMsgType("image");
//        ImageReplyJaxb.Image image = new ImageReplyJaxb.Image();
//        image.setMediaId("sdh28dfi239183bsdj");
//        imageMsg.setImage(image);

        try {
            System.out.println(JaxbMarshallerHelper.marshalToString(txtmsg));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
